<?php

namespace catchAdmin\externalGoods\model;

use catcher\base\CatchModel;

class ManifestTemplate extends CatchModel
{
    protected $name = 'db_customs_manifest_template';
    
    protected $field = [
        'id',
        'templateName',
        'ebpCode',
        'ebpName', 
        'ebcCode',
        'ebcName',
        'logisticsCode',
        'logisticsName',
        'agentCode',
        'agentName',
        'areaCode',
        'areaName',
        'customsCode',
        'portCode',
        'emsNo',
        'assureCode',
        'trafMode',
        'country',
        'insuredFee',
        'tenant_id',
        'creator_id',
        'created_at',
        'updated_at',
        'deleted_at'
    ];

    public function getList($tenant_id=0)
    {
        $where = [];
        if($tenant_id !== 0){
            $where[]=['tenant_id','=',$tenant_id];
        }

        return $this
//            ->withoutField(['updated_at','created_at','deleted_at','tenant_id','creator_id','supplier_id'], true)
            ->catchSearch()
            ->where($where)
            ->order($this->aliasField('id'), 'asc')
            ->select()
            ->toArray();
    }
} 